home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / microcrn / issue_46.arc / ISR.ARC / REGSDUMP.C < prev   
Encoding:
C/C++ Source or Header  |  1988-05-11  |  1.1 KB  |  47 lines

  1. /*    REGSDUMP.c -  Routine to dump a __regs structure
  2.  
  3.         Supports ISR article in Micro Cornucopia Magazine Issue #46
  4. */
  5.  
  6.  
  7. #include <call.h>
  8.  
  9. #define err_printf printf
  10.  
  11. #pragma vpindex __regs_dump
  12. void __regs_dump( rp )
  13. __regs far *rp;
  14. {
  15. #define _REGS (*rp)
  16.  
  17.     err_printf( "\
  18. ax-%04x  cx-%04x  si-%04x  bp-%04x  ds-%04x   pc-%04x:%04x  pswh-%02x %c%c%c%c %c%c%c%c\n\
  19. bx-%04x  dx-%04x  di-%04x           es-%04x  stk-%04x:%04x     l-%02x %c%c%c%c %c%c%c%c\n",
  20.  
  21.           _AX, _CX, _SI, _BP, _DS, _CS, _IP,
  22.  
  23.           _PSW >> 8,
  24.           rp->psw.bit.resf ? '1' : '.',
  25.           rp->psw.bit.rese ? '1' : '.',
  26.           rp->psw.bit.resd ? '1' : '.',
  27.           rp->psw.bit.resc ? '1' : '.',
  28.           _OF    ? 'o' : '.',
  29.           _DIR   ? 'd' : '.',
  30.           _INTE  ? 'i' : '.',
  31.           _TRAP  ? 't' : '.',
  32.  
  33.           _BX, _DX, _DI,      _ES, _SS, _SP,
  34.  
  35.           _PSW & 0xff,
  36.           _SIGN  ? 's' : '.',
  37.           _ZERO  ? 'z' : '.',
  38.           rp->psw.bit.res5 ? '1' : '.',
  39.           _AUXC  ? 'a' : '.',
  40.           rp->psw.bit.res3 ? '1' : '.',
  41.           _PE    ? 'p' : '.',
  42.           rp->psw.bit.res1 ? '1' : '.',
  43.           _CARRY ? 'c' : '.' );
  44. }
  45.  
  46.  
  47.